/* GUI CONVERTED from rcrp08.i (converter v1.76) Fri May  3 13:21:44 2002 */
/* rcrp08.i - Release Management Customer Schedules                     */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.8.2.6 $                                                 */
/*V8:ConvertMode=Report                                                 */
/* REVISION: 7.3    LAST MODIFIED: 10/13/92           BY: WUG *G462*    */
/* REVISION: 7.3    LAST MODIFIED: 09/29/93           BY: WUG *GG02*    */
/* REVISION: 7.3    LAST MODIFIED: 06/27/94           BY: dpm *GK36*    */
/* REVISION: 7.3    LAST MODIFIED: 01/09/95           BY: WUG *G0BY*    */
/* REVISION: 7.3    LAST MODIFIED: 04/11/95           BY: ame *F0QB*    */
/* REVISION: 7.3    LAST MODIFIED: 08/29/95           BY: bcm *G0TB*    */
/* REVISION: 7.3    LAST MODIFIED: 07/23/96           BY: *G29C* Ajit Deodhar */
/* REVISION: 8.5    LAST MODIFIED: 06/11/97           BY: *J1SX* Aruna Patil  */
/* REVISION: 8.6    LAST MODIFIED: 10/07/97           BY: bvm *K0KV*          */
/* REVISION: 8.6E   LAST MODIFIED: 02/23/98           BY: *L007* A. Rahane    */
/* REVISION: 8.6E   LAST MODIFIED: 03/18/98           BY: *J2G5* Samir Bavkar */
/* REVISION: 8.6E   LAST MODIFIED: 10/04/98           BY: *J314* Alfred Tan   */
/* REVISION: 9.1    LAST MODIFIED: 10/05/00           BY: *N08Y* Kaustubh K.  */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00           BY: *N0KP* myb          */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Revision: 1.8.2.3     BY: Katie Hilbert    DATE: 03/11/01   ECO: *N0XB*    */
/* Revision: 1.8.2.5     BY: Patrick Rowan    DATE: 04/24/01   ECO: *P00G*    */
/* $Revision: 1.8.2.6 $    BY: Katie Hilbert    DATE: 04/15/02   ECO: *P03J*    */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* SHIPMENT HISTORY REPORT INCLUDE */

/*
{1} = "break by ..."
*/


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdeclre.i}
{gplabel.i}
{wbrp02.i}
{rcrpvar.i "shared"}

define shared variable date_from  as date label "Created" no-undo.
define shared variable date_to    as date label {t001.i} no-undo.
define shared variable ship_trans like mfc_logical
                                  label "Report Shipments" no-undo.
define shared variable rtn_trans  like mfc_logical
                                  label "Report Returns" no-undo.
define shared variable cum_trans  like mfc_logical
                                  label "Report Cum Adjs/Resets" no-undo.

define variable sdb_err      as integer no-undo.
define variable last_inv_nbr as character initial ?.
define variable disp_time    as character format "x(5)"
                             label "Time".
define variable old_db       as character.
define variable l_msgdesc    like msg_desc extent 2 no-undo.

define buffer custad for ad_mstr.
define buffer shipad for ad_mstr.
define buffer dockad for ad_mstr.

/* CONSIGNMENT VARIABLES */
{socnvars.i}

/* DETERMINE IF CUSTOMER CONSIGNMENT IS ACTIVE */
{gprun.i ""gpmfc01.p""
   "(input ENABLE_CUSTOMER_CONSIGNMENT,
     input 10,
     input ADG,
     input CUST_CONSIGN_CTRL_TABLE,
     output using_cust_consignment)"}

for each scx_ref no-lock
   where scx_type = 1
     and scx_shipfrom >= shipfrom_from and scx_shipfrom <= shipfrom_to
     and scx_shipto >= shipto_from and scx_shipto <= shipto_to
     and scx_part >= part_from and scx_part <= part_to
     and scx_po >= po_from and scx_po <= po_to
     and scx_order >= order_from and scx_order <= order_to
     and scx_custref >= custref_from and scx_custref <= custref_to
     and scx_modelyr >= modelyr_from and scx_modelyr <= modelyr_to,
   each sod_det no-lock
      where sod_nbr = scx_order and sod_line = scx_line
        and sod_dock >= dock_from and sod_dock <= dock_to,
   each so_mstr no-lock
      where so_nbr = sod_nbr
        and so_cust >= cust_from and so_cust <= cust_to {1}:

   find si_mstr where si_site = scx_shipfrom no-lock.

   /* CHECK TO SEE IF LINE IS CONSIGNED */
   if using_cust_consignment then do:
      consign_flag = no.
      {gprunmo.i
         &program = "socnsod1.p"
         &module = "ACN"
         &param = """(input scx_order,
           input scx_line,
           output consign_flag,
           output consign_loc,
           output intrans_loc,
           output max_aging_days,
           output auto_replenish)"""}
   end.  /* if using_cust_consignment */

   /* CHECK THAT INVENTORY DATABASE IS CONNECTED */
   if global_db > "" and not connected (si_db) then do:

      /* ORDER NOT SELECTED, DATABASE # NOT CONNECTED */
      {pxmsg.i &MSGNUM=3820 &ERRORLEVEL=2
               &MSGBUFFER=l_msgdesc[1]
               &MSGARG1=si_db}
      /* ORDER; LINE: #; # */
      {pxmsg.i &MSGNUM=8310 &ERRORLEVEL=1
               &MSGBUFFER=l_msgdesc[2]
               &MSGARG1=sod_nbr
               &MSGARG2=sod_line}

      put unformatted skip(2)
         l_msgdesc[1]
         skip
         l_msgdesc[2]
         skip(1).
      next.
   end.

   if si_db <> global_db then do:
      old_db = global_db.

      {gprun.i ""gpalias3.p"" "(input si_db, output sdb_err)"}

      {gprun.i ""rcrp081.p""
         "(input sod_nbr,
           input sod_line,
           input sod_part,
           input sod_qty_inv,
           input sod_cum_qty[1],
           input consign_flag)"}

      {gprun.i ""gpalias3.p"" "(input old_db, output sdb_err)"}
   end.
   else do:
      {gprun.i ""rcrp081.p""
         "(input sod_nbr,
           input sod_line,
           input sod_part,
           input sod_qty_inv,
           input sod_cum_qty[1],
           input consign_flag)"}
   end.

   /* REPORT EXIT */
   
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


end.

{wbrp04.i}
